import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
const envDir = path.resolve(process.cwd(), './env');
import viteEslint from 'vite-plugin-eslint';

// https://vitejs.dev/config/
export default defineConfig({
  envDir,
  envPrefix: 'MFE_',
  resolve: {
    extensions: ['.js', '.ts', '.tsx', 'scss', '.css'],
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  server: {
    open: true,
    port: 4399
  },
  css: {
    preprocessorOptions: {
      sass: {
        math: 'always',
        globalVars: {
          blue: '#1CC0FF'
        }
      }
    }
  },
  plugins: [
    react(),
    viteEslint({
      failOnError: false
    })
  ]
});
